{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "simplified-helena",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyflink.table import DataTypes, TableEnvironment, EnvironmentSettings\n",
    "from pyflink.table.descriptors import Schema, OldCsv, FileSystem\n",
    "from pyflink.table.expressions import lit"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "weird-pastor",
   "metadata": {},
   "outputs": [],
   "source": [
    "#from pyflink.common.serialization import Encoder\n",
    "#from pyflink.common.typeinfo import Types\n",
    "from pyflink.datastream import StreamExecutionEnvironment\n",
    "#from pyflink.datastream.connectors import StreamingFileSink\n",
    "from pyflink.common."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "moving-microwave",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'StreamTableEnvironment' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-35-8a9049445f55>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0menv_settings\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mEnvironmentSettings\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnew_instance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0min_streaming_mode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0muse_blink_planner\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbuild\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mt_env\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mStreamTableEnvironment\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcreate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0menvironment_settings\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0menv_settings\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m: name 'StreamTableEnvironment' is not defined"
     ]
    }
   ],
   "source": [
    "env_settings = EnvironmentSettings.new_instance().in_streaming_mode().use_blink_planner().build() \n",
    "t_env = StreamTableEnvironment.create(environment_settings=env_settings)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "appreciated-nebraska",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyflink.datastream import StreamExecutionEnvironment"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "brilliant-monday",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ln: failed to create symbolic link ‘/bin/java’: File exists\n",
      "ln: failed to create symbolic link ‘/bin/javac’: File exists\n",
      "ln: failed to create symbolic link ‘/bin/javah’: File exists\n",
      "ln: failed to create symbolic link ‘/bin/javadoc’: File exists\n"
     ]
    }
   ],
   "source": [
    "#!sudo ln -s /usr/java/jdk-11.0.11/bin/java /bin/jar\n",
    "#!sudo ln -s /usr/java/jdk-11.0.11/bin/java /bin/java\n",
    "#!sudo ln -s /usr/java/jdk-11.0.11/bin/java /bin/javac\n",
    "#!sudo ln -s /usr/java/jdk-11.0.11/bin/java /bin/javah\n",
    "#!sudo ln -s /usr/java/jdk-11.0.11/bin/java /bin/javadoc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "ecological-replica",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "java 11.0.11 2021-04-20 LTS\r\n",
      "Java(TM) SE Runtime Environment 18.9 (build 11.0.11+9-LTS-194)\r\n",
      "Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.11+9-LTS-194, mixed mode)\r\n"
     ]
    }
   ],
   "source": [
    "#!java --version"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
